<!DOCTYPE html>
<html>
	<head>
		<title>灾害点信息</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="copyright" content="www.infoearth.com" />
		<link rel="stylesheet" href="../css/api.css">
		<link rel="stylesheet" href="../css/base.css">
		<link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" href="../lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.css">
		<script src="../lib/jquery.mobile-1.4.5/jquery.min.js"></script>
		<script src="../lib/jquery.mobile-1.4.5/jquery.mobile-1.4.5.min.js"></script>
		<script type="text/javascript" src="../script/api.js"></script>
		<script src="../lib/config.js"></script>
		<script src="../lib/common.js"></script>
	</head>
	<body>
		<div id="wrap">
			<header id='header'>
				<nav id="nav">
					<a id="left" onclick="api.closeWin();"> <span>返回</span> </a>
					<div id="middle">
						<strong id="title">灾害点信息</strong>
					</div>
					<a id="right"> </a>
				</nav>
			</header>
			<div id="main">
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="hazardCode">灾害点编号:</label>
					<input type="text" name="hazardCode" id="hazardCode" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="hazardName">灾害点名称:</label>
					<input type="text" name="hazardName" id="hazardName" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="hazardType">灾害类型:</label>
					<input type="text" name="hazardType" id="hazardType" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="location">地理位置:</label>
					<input type="text" name="location" id="location" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="scale">规模特征:</label>
					<input type="text" name="scale" id="scale" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="state">稳定性现状:</label>
					<input type="text" name="state" id="state" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="level">险情等级:</label>
					<input type="text" name="level" id="level" readonly="readonly">
				</div>
				<div class="ui-field-contain" style="margin:5px 5px;">
					<label for="people">威胁人口:</label>
					<input type="text" name="people" id="people" readonly="readonly">
				</div>
			</div>
		</div>
	</body>
	<script>
		var hazardInfo = null;
		apiready = function() {
			api.addEventListener({
				name : 'keyback'
			}, function(ret, err) {
				api.closeWin();
			});
			getHazardInfo();
		}
		function getLocation(row) {
			var location = '';
			if (row.JBQK0138 != null)
				location += row.JBQK0138;
			if (row.JBQK0139 != null)
				location += row.JBQK0139;
			if (row.JBQK0140 != null)
				location += row.JBQK0140;
			if (row.JBQK0150 != null)
				location += row.JBQK0150;
			if (row.JBQK0160 != null)
				location += row.JBQK0160;
			return location;
		}

		function getHazardInfo() {
			hazardInfo = getCookie('hazardInfo');
			if (hazardInfo == null || hazardInfo == '') {
				return;
			}
			hazardInfo = JSON.parse(hazardInfo);
//			var hazardCode = hazardInfo.JBQK0100;
			api.showProgress({
				style : 'default',
				animationType : 'fade',
				title : '正在获取数据',
				text : '请稍等...',
				modal : false
			});
			var info = hazardInfo;
			$("#hazardCode").val(info.JBQK0100);
			$("#hazardName").val(info.JBQK0110);
			$("#hazardType").val(info.JBQK0164);
			$("#location").val(getLocation(info));
			$("#scale").val(info.JBQK0161);
			$("#state").val(info.JBQK0163);
			$("#level").val(info.JBQK0165);
			$("#people").val(info.JBQK0169);
			//			var filter = "JBQK0100='" + hazardCode + "'";
			//			getRecordsByFilter("hazard", "JBQK01", filter, function(response) {
			//				if (response != null && response.record != null && response.record.length > 0) {
			//					var info = response.record[0];
			//					$("#hazardCode").val(info.JBQK0100);
			//					$("#hazardName").val(info.JBQK0110);
			//					$("#hazardType").val(info.JBQK0164);
			//					$("#location").val(getLocation(info));
			//					$("#scale").val(info.JBQK0161);
			//					$("#state").val(info.JBQK0163);
			//					$("#level").val(info.JBQK0165);
			//					$("#people").val(info.JBQK0169);
			//				}
			//			}, showErro, false);
			api.hideProgress();
		}
	</script>
</html>